﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CardsSimulator
{
    class GameController : IController
    {
        private CardGame model;
        private IView view; 

        public GameController(IView _view)
        {
            view = _view;
        }

        public void CreateGame(string path)
        {
            model = new CardGame(path);
            model.RegisterObserver((IObserver)view);
            view.SetModel(model);
            CardGame.currentGame = new CardGame(path);
            Server server = new Server();

            view.InitView();

        }

        public void JoinGame()
        {
            Client client = new Client();
            model = CardGame.currentGame;

            model.RegisterObserver((IObserver)view);
            view.SetModel(model);

            view.InitView();
        }
    }
}
